using flickr.api.communication;

namespace flickr.api
{
	public class People : FlickrObject
	{
	    public People() : base() {}
	    public People(FlickrConnection connection) : base(connection){}
	    
	    public User findByEmail(string emailToFind)
	    {
            FlickrRequest request = CreateRequest();
            request.AddParameter(FlickrParameterType.Email, emailToFind);

            return Send(request).User;
	    }

	    public User findByUsername(string userName)
	    {
            FlickrRequest request = CreateRequest();
            request.AddParameter(FlickrParameterType.UserName, userName);

            return Send(request).User;
	    }

	    public Photos getPublicPhotos(string userId)
	    {
            FlickrRequest request = CreateRequest();
	        request.AddParameter(FlickrParameterType.UserId, userId);
            request.AddParameter(FlickrParameterType.Extras, string.Empty);
            request.AddParameter(FlickrParameterType.PerPage, 100);
            request.AddParameter(FlickrParameterType.Page, 1);
	        
	        return Send(request).Photos;
	    }

	    public Person getInfo(string userId)
	    {
            FlickrRequest request = CreateRequest();
            request.AddParameter(FlickrParameterType.UserId, userId);
	        
	        return Send(request).Person;
	    }

	    public User getUploadStatus()
	    {
            FlickrRequest request = CreateRequest();

            return Send(request).User;
	    }

	    public Groups getPublicGroups(string userId)
	    {
            FlickrRequest request = CreateRequest();
	        request.AddParameter(FlickrParameterType.UserId, userId);

            return Send(request).Groups;	        
	    }
	}
}